#include<iostream>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<string>
#include<list>
#include<map>
#include<array>
#include<assert.h>
#include<vector>
using namespace std;

void test_vector6()
{
	std::vector<int> v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);

	for (auto e : v1)
	{
		cout << e << " ";
	}
	cout << endl;

	//要求删除所有的偶数
	std::vector<int>::iterator it = v1.begin();
	while (it != v1.end())
	{
		if (*it % 2 == 0)
		{
			v1.erase(it);
		}
		++it;
	}

	for (auto e : v1)
	{
		cout << e << " ";
	}
	cout << endl;
}

int main()
{
    test_vector6();
    return 0;
}
